#pragma once
#include <Strmif.h>

// Forward declaration
struct IBaseFilter;
struct IGraphBuilder;
struct IPin;
struct MusicBoxSetting;

class CLrcShowFilterWrapper
{
public:
     CLrcShowFilterWrapper();
     ~CLrcShowFilterWrapper();
     // Do the real job connect the lrc show filter with upstream filter and audio reander
     HRESULT AddLrcShowFilter(IGraphBuilder* FilterGraph);
     HRESULT RemoveLrcShowFilter(IGraphBuilder* FilterGraph);
     // Functions to create , initialize and start lrc show filter
     HRESULT CreateLrcFilter();
     void InitLrcFilter(const MusicBoxSetting & Setting);
     bool StartLrcFilter(const MusicBoxSetting & Setting);
     bool StopLrcFilter(const MusicBoxSetting & Setting);
     // Operations
     void ReloadDeskLrc(const tstring & LrcFullPath);
     void ReloadWinLrc(const tstring & LrcFullPath);
     // Like pointer
     IBaseFilter *operator->() const;
     // Release ref
     HRESULT Release();

private:
     // Add our lrc show filter helper functions
     HRESULT AddLrcShowFilterHelper(IPin * AudioPin, IGraphBuilder* FilterGraph);
     // Check wether CurFilter is a audio render
     // Rule: all pins of render must be input, and their media type must be audio
     IPin* CheckAudioRender(IBaseFilter* CurFilter);
     // Get one pin from filter according to appointed direction
     CComPtr<IPin> GetOnePin(IBaseFilter * Filter, PIN_DIRECTION Direction);


     IBaseFilter* m_LrcShowFilter;    // Lrc show filter com interface
};